package com.ruoyi.manage.controller;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.cg.pojo.Image;
import com.ruoyi.common.core.cg.result.Queryparam;
import com.ruoyi.common.core.cg.result.Result;
import com.ruoyi.common.core.cg.vo.StoreVo;
import com.ruoyi.manage.service.StoreVoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("storeVo")
public class StoreVoController {
    @Autowired
    StoreVoService storeVoService;

    @RequestMapping("getStoreVo")
    public Result getStoreVo(@RequestBody Queryparam queryparam){
        PageInfo<StoreVo> storeVos = storeVoService.getStoreVo(queryparam);
        return new Result(true,"查询成功",storeVos);
    }

    @RequestMapping("getImage")
    public Result getImage(Integer id){
        Image image = storeVoService.getImage(id);
        return new Result(true,"成功",image);
    }

    @RequestMapping("updateStoreVo")
    public Result updateStoreVo(@RequestBody StoreVo storeVo){
        storeVoService.updateStoreVo(storeVo);
        return new Result(true,"成功");
    }
    @RequestMapping("updateStoreVoNo")
    public Result updateStoreVoNo(@RequestBody StoreVo storeVo){
        storeVoService.updateStoreVoNo(storeVo);
        return new Result(true,"成功");
    }
}
